<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    #a { position: relative; }
    #b { margin-left: 5px; }
    #c { width: 50px; height: 50px; background: pink; margin-left: 10px; }
  </style>
</head>
<body>
  <div id="a">
    <div id="b">
      <div id="c"></div>
    </div>
  </div>
  <script>
    var c = document.getElementById('c');
    console.log(c.offsetParent);
    console.log(c.offsetLeft);
    console.log(c.offsetWidth);
  </script>
</body>
</html>